UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6yIYeRRQ/+2jq1e/5Ku7I2ojvIg3fMi85eopjiuMzx0=' 
WHERE 
  key_id = 'dbd9fc3e6756309faa3d153e26259aa4c448c2128dedf8462ea04b2152d550e2' 
  AND (
    token = '6yIYeRRQ/+2jq1e/5Ku7I2ojvIg3fMi85eopjiuMzx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055