UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V0U7BnutK4VIRfUm/h220lhvmXDsBc39VU7tLHxF6yQ=' 
WHERE 
  key_id = '19afbbae62d6d313883d95f88711a1660c5b5e68a31327486a6a7c797fad091c' 
  AND (
    token = 'V0U7BnutK4VIRfUm/h220lhvmXDsBc39VU7tLHxF6yQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036