UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nh1XNXM3oDx1AK94YeQHh+PomAEyN5bspGuuuYZ8z2o=' 
WHERE 
  key_id = '38a6dad38201e8c0e6651fcffb57039818ecdef6a686dd3b90b9936d92bfb925' 
  AND (
    token = 'nh1XNXM3oDx1AK94YeQHh+PomAEyN5bspGuuuYZ8z2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031