UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vp3Kj3z4L+pmhKqwLKtH7hZAutvZYxQHE1+HLGU4GFg=' 
WHERE 
  key_id = 'c6df75a023ca7bd4e354587d9cde7cca0fce32c75b15c58a39cc48cec177ab33' 
  AND (
    token = 'Vp3Kj3z4L+pmhKqwLKtH7hZAutvZYxQHE1+HLGU4GFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020