UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fkoR5AkatU11C4DBobEdGV0RIN/1VDaiZLD6+TSaRYU=' 
WHERE 
  key_id = '6088ed4003de412c13d98fcfba9876912c73eeac7910f041705211c763938f14' 
  AND (
    token = 'fkoR5AkatU11C4DBobEdGV0RIN/1VDaiZLD6+TSaRYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016