UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '47u9szAeNSRwISmbRmrHLu7hCPe0cIP2KBi/vJFCD04=' 
WHERE 
  key_id = 'c37ec3cbf7999ebb77165de76e3049233a0eeec77ac48c2d8a119bb27b6f7403' 
  AND (
    token = '47u9szAeNSRwISmbRmrHLu7hCPe0cIP2KBi/vJFCD04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025