UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lfTWDlDdeFVytSdRQCANWLv0F8HcbqMm0Wk3u80o8/M=' 
WHERE 
  key_id = '96c729adbf7cc4048ba4a93f65025dd408e886365ded997f1034a7ff2fd8cf1c' 
  AND (
    token = 'lfTWDlDdeFVytSdRQCANWLv0F8HcbqMm0Wk3u80o8/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033