UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qECim3o83Dz7DI3iWfAwMJzVfIP0pEh/p9KSc2uMUrc=' 
WHERE 
  key_id = 'cd853935c2fd6563e37066218a02bc50deb9169eb9519b52bf2f050436775d63' 
  AND (
    token = 'qECim3o83Dz7DI3iWfAwMJzVfIP0pEh/p9KSc2uMUrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035