UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+zP4eY96ksrl23sGu5Z/I9P5y3ZTjxAn/jZKPoUz/Ng=' 
WHERE 
  key_id = '67cc7329b491d92b0b4c58a7300f4d005adcab2b42ab544d6c63aa5f48251617' 
  AND (
    token = '+zP4eY96ksrl23sGu5Z/I9P5y3ZTjxAn/jZKPoUz/Ng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031