UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HKP3bYGzAxBaW29rlSo2HCmH+JTpJ+9+S+hO5iaLUBM=' 
WHERE 
  key_id = '71d6db4a48abbe02ee47510c43e000202793ffc33cd4685aeed3b6c581d5ddea' 
  AND (
    token = 'HKP3bYGzAxBaW29rlSo2HCmH+JTpJ+9+S+hO5iaLUBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020