UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ll2Ypeiv3kcon53bKaCTTHdBXVSMUeM0yt2pdOA262Y=' 
WHERE 
  key_id = 'f5734d1f430f995e22f42d6d79cc9b9189f2ec57fe396f217e26b8b15e272dbd' 
  AND (
    token = 'Ll2Ypeiv3kcon53bKaCTTHdBXVSMUeM0yt2pdOA262Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028