UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZkLGrlWNfZ15h8h94LQz7/xeCHZMrTokhLFTJZzPJDM=' 
WHERE 
  key_id = 'd78b8e4685fb1800c8c939e68f04dc31286193b88df87ab8a21e95ec0380129f' 
  AND (
    token = 'ZkLGrlWNfZ15h8h94LQz7/xeCHZMrTokhLFTJZzPJDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039