UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l9SggIye4LqoyZS3U28ahm/Y/3I4VKs0RSJVsiFTmqo=' 
WHERE 
  key_id = '5bd67700513ae9edf94f9a481b83e41ef67f5d25bf40b8f0cbc31c45a3101bd4' 
  AND (
    token = 'l9SggIye4LqoyZS3U28ahm/Y/3I4VKs0RSJVsiFTmqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030