UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yB7hNmJCUGkyvrNEnel/E/9LnW2HQyq2/8djgNl4LP8=' 
WHERE 
  key_id = '55e712983c17ad401c4fb4703a9bf714dfb57847240dbe8f4f5c62f486737f20' 
  AND (
    token = 'yB7hNmJCUGkyvrNEnel/E/9LnW2HQyq2/8djgNl4LP8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044