UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LQoYrznuOx0qQWUNCpWgFqDJWNZYwsGrcbPbV0ySoIY=' 
WHERE 
  key_id = '78ddf8d4f9c7db7b9e0ea02ea696c64be76f9321a5ad4d5a9eec989576bf7c9b' 
  AND (
    token = 'LQoYrznuOx0qQWUNCpWgFqDJWNZYwsGrcbPbV0ySoIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020