UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nij8/P3se1M05Q4koY7Ih34ukPNK/HBriQSMG7HDK70=' 
WHERE 
  key_id = '8cfb313c1942caca240705aa5c020a972ebe04c3fad281ff7fecbc7efc0fde42' 
  AND (
    token = 'Nij8/P3se1M05Q4koY7Ih34ukPNK/HBriQSMG7HDK70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033