UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+X74SHfOYyJWAMHcHWxG4EZKCdpx8s3Q+Uk+6QApQnQ=' 
WHERE 
  key_id = '97b9575e69e19db3ddcf78fa0c07f9b9535b9d52044924ad31a1971b361cbb19' 
  AND (
    token = '+X74SHfOYyJWAMHcHWxG4EZKCdpx8s3Q+Uk+6QApQnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024