UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xv1Zk0CujiRr7EICHDljlokZo0XRss/MWmjat9NGHdM=' 
WHERE 
  key_id = '6f4118aaabd4db20612f14cfab95c21e62c7fc7879aaa717d5da4c81e8d99f65' 
  AND (
    token = 'xv1Zk0CujiRr7EICHDljlokZo0XRss/MWmjat9NGHdM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061