UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5lff281QUgFi9vr5pzQX5lheOJZ2jcmCOTkl+xcyR5I=' 
WHERE 
  key_id = 'd7e7b64b2d227895775eddcaec05a13f7d9ce676479fb8f85274ef19ce0b864c' 
  AND (
    token = '5lff281QUgFi9vr5pzQX5lheOJZ2jcmCOTkl+xcyR5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018