UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '699OH80S4p9aK5s+dnLz/Nqjr5sGgFpTS2nAGenxnaY=' 
WHERE 
  key_id = 'c868f9f6d9a3c9c7bb50fc4ade9f02fafa3322fbe03fc59e7cc48497794b4c53' 
  AND (
    token = '699OH80S4p9aK5s+dnLz/Nqjr5sGgFpTS2nAGenxnaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027