UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9pq31IlDhnbzKCO/SF4sC0dTEDvgN1up+4zjiVy8X7E=' 
WHERE 
  key_id = '33e1ee29839e3e32cac368227c78b9bfdc52906c59101e22a5d46f2ea4ab2d82' 
  AND (
    token = '9pq31IlDhnbzKCO/SF4sC0dTEDvgN1up+4zjiVy8X7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034