UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FbErYvxlX6wbQAjcS8nUTIPeIKjfeoayED1DORF1r6E=' 
WHERE 
  key_id = '36e2abdb35b3161e8241b4e6ff0f761494ee63a1421c853f0ebd08b14cb570c5' 
  AND (
    token = 'FbErYvxlX6wbQAjcS8nUTIPeIKjfeoayED1DORF1r6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032