UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iF1343LeIKZ9H0eXcIHdMdJDsafNENhooo/2oyDiqbQ=' 
WHERE 
  key_id = 'e9e02b3d87932837cd5d619f126a3e961318d6bd0e5221ef0135802e5b1cc06d' 
  AND (
    token = 'iF1343LeIKZ9H0eXcIHdMdJDsafNENhooo/2oyDiqbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042