UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QJLk9CH372dSaWmGqjf2Uf0aj9xUrUOb6z3rCJGob00=' 
WHERE 
  key_id = '9890609725eeb39a62cb7538d829d11b36c1f9b1e9919b2eafc943108f3ef907' 
  AND (
    token = 'QJLk9CH372dSaWmGqjf2Uf0aj9xUrUOb6z3rCJGob00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036