UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FeeEqBTDdpTTr2WdsUwvYPqgQCUyVAJF35YqxalhB74=' 
WHERE 
  key_id = '494ee0b7826c39af6079127d9058614c747d36733b4542e05f7d2cc9130b0663' 
  AND (
    token = 'FeeEqBTDdpTTr2WdsUwvYPqgQCUyVAJF35YqxalhB74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041