UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lmZVi2F8zuWb/eAI2Co6pJ7IYpXuleM6qvje9RU8CCc=' 
WHERE 
  key_id = 'fab7e547e8e2900084050adc8c6933b5e370a77427bf746a81aa457ab494138b' 
  AND (
    token = 'lmZVi2F8zuWb/eAI2Co6pJ7IYpXuleM6qvje9RU8CCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031