UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3dEkXmr9Qo7uxe8ZIXDyUtH/vA5uBWG9V3kwN8GKHSI=' 
WHERE 
  key_id = 'd72576461f4f4558f129f5be4d377221fd8b8c6ef995cd6363a2aee6a77a2d42' 
  AND (
    token = '3dEkXmr9Qo7uxe8ZIXDyUtH/vA5uBWG9V3kwN8GKHSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027