UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BAcM6tOz/uMtd+2xPRwsg1esVCShMBOHOG4hQdJyWC4=' 
WHERE 
  key_id = 'ebbb5ffe82ce8b4bb1121fc4eb931adeb6c8e18177c8d21ff47401c74a7ba5a7' 
  AND (
    token = 'BAcM6tOz/uMtd+2xPRwsg1esVCShMBOHOG4hQdJyWC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033