UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bZTFzAsl+p/TC+vkX81FWadDiAG6aEjabeXb/vpmo0U=' 
WHERE 
  key_id = 'c53a30165968793aae4045e9396b5d3aa7d8e5c1446c4a032841658f5f9ee04a' 
  AND (
    token = 'bZTFzAsl+p/TC+vkX81FWadDiAG6aEjabeXb/vpmo0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037