UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ds5HKt43FFOpem9OSuh+6NzkbjJRhXctXdsrHr0gtjs=' 
WHERE 
  key_id = '7cc13ea032aaa9ba50796605d1f48c309770d0e5b85e3c9a4a3af1ccad134e08' 
  AND (
    token = 'Ds5HKt43FFOpem9OSuh+6NzkbjJRhXctXdsrHr0gtjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032