UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eqar1I9KZ0q8bhukl/sAE8bGq3m4CSJXZ5sXRqjZ3UQ=' 
WHERE 
  key_id = '8c497156c2b4f771a341df9716b46b0061f87fa43a12d46ef1a4e1fe903724ba' 
  AND (
    token = 'eqar1I9KZ0q8bhukl/sAE8bGq3m4CSJXZ5sXRqjZ3UQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024