UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rCxHHAh/gEOkJ8ZqgnI8+J/l+zEudREh6WylxQH289I=' 
WHERE 
  key_id = '5651f13f28e8fd8bc9f5b87899dd2a85d18db0b5cb1e8eaa4bd29e4ea0e4292f' 
  AND (
    token = 'rCxHHAh/gEOkJ8ZqgnI8+J/l+zEudREh6WylxQH289I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034