UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S5+RSPyMVCB8s3UCtZfobd5xo3aVT/AoV+NRMu1XZlw=' 
WHERE 
  key_id = 'fbbf42bddb4f90d27ffe820ec9d353352311bd26fc5d1e9f652cb32d5e9e7019' 
  AND (
    token = 'S5+RSPyMVCB8s3UCtZfobd5xo3aVT/AoV+NRMu1XZlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030