UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GjrCQSoMYNLVC++E1O3ZNeYpyxTDdbwy2lxya4HUnTI=' 
WHERE 
  key_id = 'a292935314b484e9a96c6682d61cfda7451354e8d0b48e12f28d5fe4c9780d27' 
  AND (
    token = 'GjrCQSoMYNLVC++E1O3ZNeYpyxTDdbwy2lxya4HUnTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031