UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VBwmcQwUOaQg8/WNS8PYKyhph/U9gTWObPW6E1GNE+A=' 
WHERE 
  key_id = 'de0b4a4c52ca00eb929477cc4d7d40a3983fd442ac9f5a7fef661684e9ef5d58' 
  AND (
    token = 'VBwmcQwUOaQg8/WNS8PYKyhph/U9gTWObPW6E1GNE+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036