UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rqq2PzHhaxLpjBECH0c9hyBY0K8vFHtlMWVJgtBareM=' 
WHERE 
  key_id = '069135d7d19ecf4f6826ec8357d33915d810b822438d3db7a8cba791a5b60c51' 
  AND (
    token = 'rqq2PzHhaxLpjBECH0c9hyBY0K8vFHtlMWVJgtBareM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039